open(BUFF,"ls ./OV_expr_tumor |");
open(WRBUFF,">merge_expr_OV_expr_tumor");
$i =0;
while($line = <BUFF>)
{
	chomp($line);
	#print $line."\n";
	@temp = split('-',$line);
	$ar[$i] = $temp[0].'-'.$temp[1].'-'.$temp[2];
	if(!(exists($hsh{$ar[$i]})))
	{
	$hsh{$ar[$i]} = 1;
	$i++;
	open(BUFF1,"./OV_expr_tumor/$line");
	$liney = <BUFF1>;
	
	while($liney = <BUFF1>)
	{
		chomp($liney);
		@array = split(/\t/,$liney);
		if(exists($hash{$array[0]}))
		{
			$hash{$array[0]} = $hash{$array[0]}."\t".$array[1];
		}
		else
		{
			$hash{$array[0]} = $array[1];
		}	
	}
	}
}
$line = join("\t",@ar);
print WRBUFF $line."\n";
while(($key,$value)= each %hash)
{
	print WRBUFF $key."\t".$value."\n";
}
